//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.test;

import java.util.Scanner;

public class 数字加密 {
    public 数字加密() {
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int password = sc.nextInt();
        encryption(password);
    }

    private static void encryption(int password) {
        int password2 = password;

        int count;
        for(count = 0; password2 != 0; ++count) {
            password2 /= 10;
        }

        int[] arr = new int[count];

        for(int i = 0; i < count; ++i) {
            arr[i] = password % 10;
            password /= 10;
        }

        for(int i = 0; i < arr.length; ++i) {
            arr[i] = (arr[i] + 5) % 10;
        }

        for(int i = 0; i < arr.length; ++i) {
            System.out.print(arr[i]);
        }

    }
}
